import { DtoValidation } from '@/modules/core/decorators/dto-validation.decorator';
import { Injectable } from '@nestjs/common';
import { Transform } from 'class-transformer';
import { IsNotEmpty, IsOptional } from 'class-validator';

@Injectable()
@DtoValidation({ type: 'body', groups: ['pay'] })
export class PayDto {
  @IsNotEmpty({ message: '订单号不能为空' })
  orderId: string;

  @IsNotEmpty({ message: '金额不能为空' })
  totalPrice: string;

  @IsNotEmpty({ message: '返回地址不能为空', groups: ['pay'] })
  @IsOptional({ groups: ['orderRefund'] })
  returnUrl: string;
}
